<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\fcs\vpos\service\guide;

class GetPerformanceReq {
	
	static $_TSPEC;
	public $companyCode = null;
	public $userId = null;
	public $storeCode = null;
	public $performanceType = null;
	public $dtBegin = null;
	public $dtEnd = null;
	public $customerRange = null;
	public $taskType = null;
	public $remainType = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'companyCode'
			),
			2 => array(
			'var' => 'userId'
			),
			3 => array(
			'var' => 'storeCode'
			),
			4 => array(
			'var' => 'performanceType'
			),
			5 => array(
			'var' => 'dtBegin'
			),
			6 => array(
			'var' => 'dtEnd'
			),
			7 => array(
			'var' => 'customerRange'
			),
			8 => array(
			'var' => 'taskType'
			),
			9 => array(
			'var' => 'remainType'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['companyCode'])){
				
				$this->companyCode = $vals['companyCode'];
			}
			
			
			if (isset($vals['userId'])){
				
				$this->userId = $vals['userId'];
			}
			
			
			if (isset($vals['storeCode'])){
				
				$this->storeCode = $vals['storeCode'];
			}
			
			
			if (isset($vals['performanceType'])){
				
				$this->performanceType = $vals['performanceType'];
			}
			
			
			if (isset($vals['dtBegin'])){
				
				$this->dtBegin = $vals['dtBegin'];
			}
			
			
			if (isset($vals['dtEnd'])){
				
				$this->dtEnd = $vals['dtEnd'];
			}
			
			
			if (isset($vals['customerRange'])){
				
				$this->customerRange = $vals['customerRange'];
			}
			
			
			if (isset($vals['taskType'])){
				
				$this->taskType = $vals['taskType'];
			}
			
			
			if (isset($vals['remainType'])){
				
				$this->remainType = $vals['remainType'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'GetPerformanceReq';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("companyCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->companyCode);
				
			}
			
			
			
			
			if ("userId" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->userId); 
				
			}
			
			
			
			
			if ("storeCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->storeCode);
				
			}
			
			
			
			
			if ("performanceType" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->performanceType);
				
			}
			
			
			
			
			if ("dtBegin" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->dtBegin); 
				
			}
			
			
			
			
			if ("dtEnd" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->dtEnd); 
				
			}
			
			
			
			
			if ("customerRange" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->customerRange);
				
			}
			
			
			
			
			if ("taskType" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->taskType);
				
			}
			
			
			
			
			if ("remainType" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->remainType);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('companyCode');
		$xfer += $output->writeString($this->companyCode);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->userId !== null) {
			
			$xfer += $output->writeFieldBegin('userId');
			$xfer += $output->writeI64($this->userId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->storeCode !== null) {
			
			$xfer += $output->writeFieldBegin('storeCode');
			$xfer += $output->writeString($this->storeCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldBegin('performanceType');
		$xfer += $output->writeString($this->performanceType);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('dtBegin');
		$xfer += $output->writeI64($this->dtBegin);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('dtEnd');
		$xfer += $output->writeI64($this->dtEnd);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('customerRange');
		$xfer += $output->writeString($this->customerRange);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('taskType');
		$xfer += $output->writeString($this->taskType);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('remainType');
		$xfer += $output->writeString($this->remainType);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>